const rechargeApi = {
    /**
     * 充值账单列表
     *
     * @returns {Promise<RechargeBillingResponse[]>}
     * @author zero
     */
    billing(): Promise<RechargeBillingResponse[]> {
        return $request.get<RechargeBillingResponse[]>({
            url: '/recharge/billing'
        })
    },

    /**
     * 充值套餐列表
     *
     * @returns {Promise<RechargePackageResponse[]>}
     * @author zero
     */
    package(): Promise<RechargePackageResponse[]> {
        return $request.get<RechargePackageResponse[]>({
            url: '/recharge/package'
        })
    },

    /**
     * 充值下单发起
     *
     * @param {Object} params
     * @param {number} params.package_id - 套餐ID
     * @returns {Promise<any>}
     * @author zero
     */
    place(params: {
        package_id: number;
    }): Promise<any> {
        return $request.post({
            url: '/recharge/place',
            params
        })
    }
}

export default rechargeApi